package com.jy.controller;

import com.jy.model.User;
import com.jy.model.Menu;
import com.jy.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartResolver;

import java.util.List;

/**
 * Created by Administrator on 2017/5/10 0010.
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserInfoService userInfoService;
    @Autowired
    MultipartResolver multipartResolver;
    @RequestMapping("/searchUser")
    public @ResponseBody List<User> searchUser(String searchUser) {
        List<User> user=userInfoService.searchUser(searchUser);
        return user;
    }

    @RequestMapping("/getMenu")
    public @ResponseBody List<Menu> getMenu(String userid) {
        List<Menu> menuList=userInfoService.menulist(userid);
        return menuList;
    }

}
